package sinoservices.demo.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sinoservices.demo.entity.Userinfo;
import sinoservices.demo.mapper.UserinfoMapper;

import java.util.List;

@Service
public class UserinfoService {
    @Autowired
    private UserinfoMapper userinfoMapper;

    public Userinfo saveUser(Userinfo userinfo){
        int save = userinfoMapper.saveUser(userinfo);
        return userinfo;
    }

    public int deleteUserById(int id){
        return userinfoMapper.deleteUserById(id);
    }

    public int updateUser(Userinfo userinfo){
        return userinfoMapper.updateUser(userinfo);
    }

    public Userinfo getUserInfo(int id){
        return userinfoMapper.getUserInfo(id);
    }

    public List<Userinfo> selectAllUser(){
        return userinfoMapper.selectAllUser();
    }
}
